package cn.com.open.itembank.dto;

/**
 * 策略小题组.
 */
public class RuleItemGroup extends ItemGroup {
    /**
     * Instantiates a new Rule item group.
     */
    public RuleItemGroup() {
        super();

        this.itemCount = 0;
        this.subItemCount = 0;
        this.minDuration = 0;
        this.maxDuration = 0;
        this.subjectiveSearchScope = 0;
    }

    /**
     * 试题数.
     */
    private Integer itemCount;

    /**
     * 填空空数/阅读理解小题数.
     */
    private Integer subItemCount;

    /**
     * 最小时长.
     */
    private double minDuration;

    /**
     * 最大时长.
     */
    private double maxDuration;

    /**
     * 主客观搜索范围.
     */
    private Integer subjectiveSearchScope;

    /**
     * Gets item count.
     *
     * @return the item count
     */
    public Integer getItemCount() {
        return itemCount;
    }

    /**
     * Sets item count.
     *
     * @param itemCount the item count
     */
    public void setItemCount(Integer itemCount) {
        this.itemCount = itemCount;
    }

    /**
     * Gets sub item count.
     *
     * @return the sub item count
     */
    public Integer getSubItemCount() {
        return subItemCount;
    }

    /**
     * Sets sub item count.
     *
     * @param subItemCount the sub item count
     */
    public void setSubItemCount(Integer subItemCount) {
        this.subItemCount = subItemCount;
    }

    /**
     * Gets min duration.
     *
     * @return the min duration
     */
    public double getMinDuration() {
        return minDuration;
    }

    /**
     * Sets min duration.
     *
     * @param minDuration the min duration
     */
    public void setMinDuration(double minDuration) {
        this.minDuration = minDuration;
    }

    /**
     * Gets max duration.
     *
     * @return the max duration
     */
    public double getMaxDuration() {
        return maxDuration;
    }

    /**
     * Sets max duration.
     *
     * @param maxDuration the max duration
     */
    public void setMaxDuration(double maxDuration) {
        this.maxDuration = maxDuration;
    }

    /**
     * Gets subjective search scope.
     *
     * @return the subjective search scope
     */
    public Integer getSubjectiveSearchScope() {
        return subjectiveSearchScope;
    }

    /**
     * Sets subjective search scope.
     *
     * @param subjectiveSearchScope the subjective search scope
     */
    public void setSubjectiveSearchScope(Integer subjectiveSearchScope) {
        this.subjectiveSearchScope = subjectiveSearchScope;
    }

    @Override
    public RuleItemGroup copy() {
        RuleItemGroup copy = new RuleItemGroup();
        copy.setItemGroupSerialNum(getItemGroupSerialNum());
        copy.setQuestionTypeID(getQuestionTypeID());
        copy.setQuestionCategories(getQuestionCategories());
        copy.setResponseDuration(getResponseDuration());
        copy.setRepeatInterval(getRepeatInterval());
        copy.setRepeatTimes(getRepeatTimes());
        copy.setSubjective(isSubjective());
        copy.setSubjectiveSearchScope(getSubjectiveSearchScope());

        for (String chapterId : getChapterIDs()) {
            copy.getChapterIDs().add(chapterId);
        }

        for (Double difficulty : getDifficulties()) {
            copy.getDifficulties().add(difficulty);
        }

        copy.itemCount = itemCount;
        copy.subItemCount = subItemCount;
        return copy;
    }
}
